import axios from "axios";
import nProgress from "nprogress";
import "nprogress/nprogress.css";
const wyRequest = axios.create({
  baseURL: "wy",
  timeout: 5000,
  headers: {},
});
//网易严选请求二次封装
wyRequest.interceptors.request.use((config) => {
  nProgress.start();
  config.headers["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
  return config;
});

wyRequest.interceptors.response.use(
  (response) => {
    nProgress.done();
    return response.data;
  },
  (message) => {
    console.log(message);
  }
);

export default wyRequest;
